package com.guchenbo.example.ds.tree;

/**
 * Created by CreGu on 2016/5/26.
 */
public class TreeApp {

    public static void main(String[] args) {

        Tree tree=new Tree();

//        for (int i = 0; i < 10; i++) {
//            tree.insert((int) (Math.random() * 10 * 16));
//        }
        tree.insert(50);
        tree.insert(40);
        tree.insert(30);
        tree.insert(60);
        tree.insert(45);
        tree.insert(65);
        tree.insert(55);
        tree.insert(70);

        System.out.println(tree.find(30));
        tree.inOrder(tree.getRoot());
        tree.findMin().display();
        tree.findMax().display();

        System.out.println("##############################");
        tree.delete(70);
        tree.inOrder(tree.getRoot());
    }
}
